const { defineConfig } = require('@vue/cli-service')


process.env.VUE_APP_VERSION = require('./package.json').version;

module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    proxy: {
      '/api1': { 
        // 已经挂了
        target: 'https://www.ceic.ac.cn/ajax', // 真实请求URl   https://www.ceic.ac.cn/ajax/speedsearch?num=1&&page=4
        ws: true,
        changeOrigin: true, // 允许跨域
        pathRewrite: { 
          '^/api1': ''
        }
      },
      '/api2': {
        target: 'https://www.baidu.com', 
        ws: true,
        changeOrigin: true, 
        pathRewrite: { 
          '^/api2': ''
        }
      }
    },
    client: {
      overlay: false,
    },
  }
})
